package com.tk.exam.vo.paper;

import com.tk.exam.domain.TkQuestions;
import com.tk.exam.domain.TkRPaperQuestion;
import com.tk.exam.vo.question.resp.TkAnswerPD;
import com.tk.exam.vo.question.resp.TkQuestionPDRespVo;
import lombok.Data;

import java.util.Objects;

@Data
public class GetStuJudgeQAResp extends TkAnswerPD {
    private String quesTitle;
    private int sortIndex;

    public GetStuJudgeQAResp(TkRPaperQuestion tkRPaperQuestion,TkQuestions question, TkQuestionPDRespVo answer) {
        if(Objects.nonNull(question)){
            setQuesTitle(question.getQuesTitle());
        }
        if(Objects.nonNull(tkRPaperQuestion)){
            setSortIndex(tkRPaperQuestion.getSortIndex());
        }
        if(Objects.nonNull(answer)){
            setChoseType(answer.getChoseType());
        }
    }
}
